{% extends 'front/front_base.html' %}
{% block title %}
    帖子详情
{% endblock %}
{% block css %}
    <link href="{{ static('front/css/front_post_detail.css') }}" rel="stylesheet">
{% endblock %}
{% block content %}

    <div class="lg-container">
        <div class="post-container">
            <h3>{{ post.title }}</h3>
            <p class="post-info-group">
                <span> 发表时间：{{ post.create_time|time_format }}</span>
                <span> 作者：{{ post.author.username }}</span>
                <span> 所属板块：{{ post.board.name }}</span>
                <span> 阅读数：{{ post.read_count }}</span>
                <span> 评论数：0</span>
            </p>
            <article class="post-content" data-id="{{ post.id }}" id="post-content">
                {{ post.content|safe }}
            </article>
        </div>
        <div class="comment-group">
            <h3>评论列表</h3>
            <ul class="comment-list-group">
                {% for comment in post.comments %}
                    <li>
                    <div class="avatar-group">
                        <img src="{{ comment.author.avatar or static('common/images/logo.jpg') }}" alt="">
                    </div>
                    <div class="comment-content">
                        <p class="author-info">
                            <span>{{ comment.author.username }}</span>
                            <span>{{ comment.create_time| time_format }}</span>
                        </p>
                        <p class="comment-txt">
                            {{ comment.content|safe }}
                        </p>
                    </div>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <div class="add-comment-group">
            <h3>发表评论</h3>
            <script id="editor" type="text/plain"></script>
            <div class="comment-btn-group">
                <button class=" btn btn-primary" id="comment-btn"> 发表评论</button>

            </div>
        </div>
    </div>
    <div class="sm-container">

    </div>

{% endblock %}
{% block js %}
    <!-- 配置文件 -->
    <script type="text/javascript" src="{{ static('ueditor/ueditor.config.js') }}"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="{{ static('ueditor/ueditor.all.js') }}"></script>
    <script type="text/javascript" src="{{ static('front/js/front_post_detail.js') }}"></script>
{% endblock %}